package com.ly.service;

import com.ly.bean.EasybuySeckillOrder;

import java.util.List;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
public interface SeckillOrderService {


    int deleteByPrimaryKey(Integer id);

    int insert(EasybuySeckillOrder record);

    int insertSelective(EasybuySeckillOrder record);

    EasybuySeckillOrder selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(EasybuySeckillOrder record);

    int updateByPrimaryKey(EasybuySeckillOrder record);

    //添加抢购商品的订单信息
    String addKillOder(String userId,Integer seckillId) throws Exception;

    //获取该用户的未支付秒杀订单列表信息
    List<EasybuySeckillOrder> findKillOrderFromRedisByUid(Integer userID) throws Exception;

    //通过抢购商品的订单id从redis中获取订单信息
    EasybuySeckillOrder findKillOrderFromRedisBySeckillId(Integer seckillId,Integer userId) throws Exception;

    //进入支付页面  然后把这个抢购的商品订单从redis中删除 然后再添加到MySQL中
    void addKillOrderToMysql(EasybuySeckillOrder seckillOrder,Integer userId) throws Exception;

    //抢购商品的剩余支付时间为0 删除此订单
    void deleteKillOrderFromRedis(Integer goodId,Integer userId) throws Exception;
}
